<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>添加图书</title>
    


  </head>
  
  <body>
  	<div>
  		<div><h1>增加图书</h1></div>
  		<div>
  			<form action="book/add" method="post" onsubmit="return check()">
  				<ul>
  					<li><span>书名</span><input type="text" name="name" id="name"/></li>
  					<li><span>作者</span><input type="text" name="author" id="author"/></li>
  					<li><span>出版社</span><input type="text" name="publish" id="publish"/></li>
  					<li><span>出版日期</span><input type="date" name="publishdate" id="publishdate"/></li>
  					<li><span>页数</span><input type="text" name="page"></li>
  					<li><span>价格</span><input type="text" name="price"></li>
  					<li><span>内容摘要</span>
						<textarea rows="5px;" cols="30px;" name="content" style="resize:none;">
						</textarea>
					</li>
					<li><input type="submit" value="提交"/><input type="button" value="返回" onclick="location.href='index.jsp'"/></li>
  				</ul>
  			</form>
  		</div>
  	</div>
  </body>
  <script type="text/javascript" src="JS/jquery-1.7.2.min.js"></script>
  <script type="text/javascript">
  function check(){
  	var name = $('#name').val();
  	var author = $('#author').val();
  	var publish = $('#publish').val();
  	var publishdate = $('#publishdate').val();
  	if(name==''||name==null){
  		alert("不能为空");
  		return false;
  	}
  }
  </script>
</html>
